from django.contrib.auth.models import Group
from rest_framework.permissions import DjangoModelPermissions, IsAdminUser

from apps.wthg_admin.serializers.group import GroupModelSerializer
from  rest_framework.viewsets import ModelViewSet
from apps.wthg_admin.utils import UtilsPageNumberPagination
from django.contrib.auth.models import Permission
from rest_framework.generics import ListAPIView
from apps.wthg_admin.serializers.group import PermissionModelSerializer

class GroupModelViewSet(ModelViewSet):
    """组权限表增删改查"""
    queryset = Group.objects.all()
    serializer_class = GroupModelSerializer
    pagination_class = UtilsPageNumberPagination


class PermissionListAPIView(ListAPIView):
    """权限类型查看"""
    queryset = Permission.objects.all()
    serializer_class = PermissionModelSerializer


